package org.moze.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.moze.annotation.KthLog;
import org.springframework.stereotype.Component;

/**
 * 结合自定义注解使用的切面类
 * KthLog
 */
@Component
@Aspect
public class KthLogAspect {

    @Pointcut("@annotation(org.moze.annotation.KthLog)")
    public void pointcut() {}

    @Before("pointcut() && @annotation(logger)")
    public void advice(KthLog logger) {
        System.out.println("--- Kth日志的内容为[" + logger.value() + "] ---");
    }

}
